<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<div class="page_right">
    <div class="equipment_query_dv">
        <p class="equipment_query_dvp">* 输入IMEI/MAC码、设备简码任一项，即可查询设备。</p>
        <dl>
            <dt>IMEI/MAC码：</dt>
            <dd><input type="text" class="equipment_query_input1" placeholder="请输入IMEI/MAC码"></dd>
            <dt>设备简码：</dt>
            <dd><input type="text" class="equipment_query_input2" placeholder="请输入设备简码"></dd>
        </dl>
        <div><input type="button" class="equipment_query_inputbtn" value="查询" disabled="disabled"></div>
    </div>
</div>
<div class="page_line"></div>
<script type="application/javascript">
    $(".equipment_query_inputbtn").on("click", function(){
        if($(this).hasClass("cur")){
            var imei = $(".equipment_query_input1").val();
            var shortCode = $(".equipment_query_input2").val();
            $.ajax({
                url: uri+"search",
                type: 'POST',
                data: {"imei":imei,"shortCode":shortCode},
                error: function (response) {
                    $errorMsg(response);
                },
                success: function (ret) {
                    if(ret.result==true){
                        var deviceType = ret.deviceType;
                        var deviceName = ret.deviceName;
                        window.location.href=uri+deviceType+"/showParamView/"+deviceName;
                    }else{
                        alert("没有找到数据！");
                    }
                }
            });
        }
    });
</script>